﻿using System;
using System.CodeDom.Compiler;

namespace SWF
{
    public struct PrimitiveInteger : IPrimitive
    {
        public PrimitiveType PrimitiveType { get { return PrimitiveType.Integer; } }
        public object Value { get { return IntegerValue; } }
        public int Length { get { return 4 + 1; } }
        public int IntegerValue;

        public PrimitiveInteger(SwfReader r)
        {
            IntegerValue = r.GetInt32();
        }

        public void ToFlashAsm(IndentedTextWriter w)
        {
            w.Write(IntegerValue);
        }
    }
}
